


static func mouseMove_gear(_self, _delta):
	if(gb.mp(MOUSE_BUTTON_LEFT) and _self.catched_gear):
		var mp = _self.get_global_mouse_position()
		_self.catched_gear.position = mp;
	if(gb.kp(KEY_MINUS) and _self.catched_gear):
		_self.catched_gear.free();
		_self.catched_gear = false;
	if(gb.kp(KEY_EQUAL) and _self.catched_gear):
		if(typeof(_self.catched_gear.gear_spd_fix) == TYPE_BOOL):
			_self.catched_gear.gear_spd_fix = _self.catched_gear.gear_speed
		else: 
			_self.catched_gear.gear_spd_fix = false

	var mp = _self.get_global_mouse_position()
	if gb.ajp('mouse_right'):
		if gb.ap('debug_gear'):
			var obj = _self.gear_prototype.duplicate()
			obj.position = mp
			_self.gear_container.add_child(obj)
		if gb.ap('debug_catch'):
			var obj = _self.grab_prototype.duplicate()
			obj.position = mp
			_self.grab_container.add_child(obj)
	
	if gb.ajp('mouse_left'):
		var gearList = _self.get_tree().get_nodes_in_group('gear_group')
		for g in gearList:
			if(g.position.distance_to(mp) < g.gear_radius):
				g.position = mp
				_self.catched_gear = g;
				break

	if gb.ajr('mouse_left'):
		_self.catched_gear = false;

	if gb.ajp('debug_catch'):
		var grabList = _self.get_tree().get_nodes_in_group('grab_group')
		for g in grabList:
			var isClose = g.gear.position.distance_to(mp) < g.gear.gear_radius;
			if(isClose):
				if(g.claw.do_grabing): g.claw.drop()
				else:	g.claw.grab()
				break;
	
	if gb.ajp('debug_visible'):
		var gearList = _self.get_tree().get_nodes_in_group('gear_group')
		for g in gearList:
			if(g.position.distance_to(mp) < g.gear_radius):
				g.sprite_obj.visible = !g.sprite_obj.visible
				break
